#include "randomstring.h"
#include <QTime>
#include <QRandomGenerator>


randomString::randomString()
{

}


QString generateRandomString(int length)
{
    QString possibleCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    QString randomString;
    QTime time = QTime::currentTime();
    QRandomGenerator random(time.msec());

    for (int i = 0; i< length; ++i) {
        int index = random.bounded(possibleCharacters.length() - 1);
        randomString.append(possibleCharacters.at(index));
    }

    return randomString;
}
